<?php
if (isset($_POST['op'])){
    $data=$_POST['data'];
    $filePath='../upic/'.$_POST['op'];
    
    $image = new Imagick('../img/template.jpg');
    $tu = new Imagick('../img/q1/'.$data.'.png');
    $tu->resizeImage(610, 610,Imagick::FILTER_LANCZOS,1);
    
    $image->compositeImage($tu, Imagick::COMPOSITE_DEFAULT, 78, 290);
    
    $image->writeImage($filePath.'-u2.jpg');
    
    echo 200;
    
}
 